<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>Lack of Cohesion in Methods - Henderson-Sellers</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <link href="../../style.css" type="text/css" rel="STYLESHEET"/>
    </head>
    <body>
        <h1>Henderson-Sellers
        	<span id="logo"><a href="http://eclipse-metrics.sourceforge.net"> <img src="../../images/logo.gif" border="0" alt="Metrics Logo"/></a></span>
        </h1>
        <p>Henderson-Sellers defines Lack of Cohesion in Methods as follows. Let:</p>
        <blockquote>
            <table>
                <tr>
                    <td><b>M</b></td>
                    <td>be the set of methods defined by the class</td>
                </tr>
                <tr>
                    <td><b>F</b></td>
                    <td>be the set of fields defined by the class</td>
                </tr>
                <tr>
                    <td><i><font face="Symbol">r</font>(f)</i></td>
                    <td>be the number of methods that access field <i>f</i>, where <i>f</i> is a member of <b>F</b></td>
                </tr>
                <tr>
                    <td><i>&lt;<font face="Symbol">r</font>&gt;</i></td>
                    <td>be the mean of <i><font face="Symbol">r</font>(f)</i> over <b>F</b>.</td>
                </tr>
            </table>
        </blockquote>
        <p>Then:</p>
        <blockquote>
            <table>
                <tr>
                    <td rowspan="2">Lack of Cohesion in Methods</td>
                    <td rowspan="2">=</td>
                    <td align="center"><u><i>&lt;<font face="Symbol">r</font>&gt;</i> - |<b>M</b>|</u></td>
                </tr>
                <tr>
                    <td align="center">1 - |<b>M</b>|</td>
                </tr>
            </table>
        </blockquote>
        <hr/>
        <p><b>Note 1:</b> I have only included methods if they access at least one field.</p>
        <p><b>Note 2:</b> I have only included fields if they are accessed by at least one method in the class.</p>
        <hr/>
        <div class="attribution">
    		This plugin is provided by <a href="http://www.stateofflow.com" title="State Of Flow homepage">State Of Flow</a>
    	</div>
    </body>
</html>